home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / graphics / gle32h_1.zip / gle32 / gle.doc / manual.txt < prev    next >
Text File  |  1992-01-14  |  72KB  |  1,935 lines

  1.     Note: This text copy of the manual does not include any
  2.     of the diagrams or examples which appear in the 'real'
  3.     manual.  A copy of the real manual can be ordered
  4.     from DSIR. ($20 a copy)
  5.  
  6. Abstract
  7. --------
  8.      GLE  is  a  high  quality  graphics  package for scientists,
  9.      combining  a  user  friendly  interface with a full range of
  10.      facilities    for   producing  publication  quality  graphs,
  11.      diagrams, posters and slides.
  12.  
  13.      GLE  provides  LaTeXquality  fonts  together with a flexible
  14.      graphics  module  which  allows  the  user  to  specify  any
  15.      feature  of a graph (down to the line width of the subticks,
  16.      for example)
  17.  
  18.      Complex  pictures can be drawn with user defined subroutines
  19.      and simple looping structures.
  20.  
  21.      Current  device  drivers support DECWINDOWS, REGIS, TEK4010,
  22.      all  PC  graphics  cards,  VT100s,  HP-Plotters,  PostScript
  23.      Printers, EPSON Printers and LaserJet Printers.
  24.  
  25.      GLE  runs  on  both  VAXes and PCs, giving an identical user
  26.      interface on both platforms.
  27.  
  28.  
  29.  GLE Installation on a PC
  30.  ------------------------
  31.      To  install GLE, put the distribution disk into drive a: and
  32.      type:
  33.  
  34.           a:install
  35.  
  36.      GLE  requires  at  least  800K  of  disk space for a minimal
  37.      installation  and  3.3M  for  a full installation (including
  38.      all device drivers and fonts).
  39.  
  40.      GLE  also  requires 530K or more of free memory. Use the DOS
  41.      command  CHKDSK  to  check  this  figure.  If you don't have
  42.      enough  then take copies of your AUTOEXEC.BAT and CONFIG.SYS
  43.      files  and then remove as much as possible from these files.
  44.  
  45.      GLE  may  work  with  less  memory depending on what you are
  46.      drawing.
  47.  
  48.      The  installation disk contains a version of CGLE which will
  49.      make  use  of  epanded memory. This version can run with 70K
  50.      less  memory  but  if you don't have expanded memory then it
  51.      has  to  use  your  hard  disk instead which is a great deal
  52.      slower.
  53.  
  54.  Running GLE
  55.  -----------
  56.      To    get  GLE  running  interactively  you  must  be  on  a
  57.      VAXstation,  graphics terminal, or PC. If you are using a PC
  58.      you  should  make certain you have an up to date copy of GLE
  59.      (ask via VAX-mail to GRV::SRGHCXP or InterNET
  60.      srghcxp@grv.dsir.govt.nz)
  61.  
  62.  Running GLE on a PC
  63.  -------------------
  64.      The command to run GLE is:
  65.  
  66.           C:\GLE> cgle myfile.gle  
  67.  
  68.      Note:  the  command is `CGLE' not `GLE' but the directory is
  69.      `GLE', this is for historical reasons.
  70.  
  71.      To  print  a  GLE  file to the laser printer you would type:
  72.  
  73.           C:> psgle myfile 
  74.           C:> print myfile.ps 
  75.  
  76.      To  produce  an  .eps  file for inclusion in WordPerfect you
  77.      would type:
  78.  
  79.           C:> psgle myfile /eps 
  80.  
  81.      This will create a file called myfile.EPS.
  82.  
  83.      If  your  PC  is  connected  to  a  VAX computer which has a
  84.      PostScript  printer  you may copy MYFILE.PS to the VAX using
  85.      a  standard  file transfer program (e.g. FTP, KERMIT, VDISK)
  86.  
  87.      The  best  way to see what GLE can do is to have a play with
  88.      it,  simply  start  it  up and try out some of the examples:
  89.  
  90.           Press F3       (Load file) 
  91.           Press <enter>  (for a menu of GLE files)
  92.           Use arrow keys to select example, then press <enter>
  93.           Press F10 to draw the picture
  94.           Press ESC to get back to the GLE editor.
  95.           ...
  96.           When you find a graph try pressing F9 and modifying 
  97.           one of the fields (use F1 for an explanation of each 
  98.           field).
  99.  
  100.  Running GLE on a VAX
  101.  --------------------
  102.      The command to run GLE is:
  103.  
  104.           $ cgle myfile.gle
  105.           $ cgle myfile.gle /dev=regis
  106.           $ cgle myfile.gle /dev=x
  107.  
  108.      See    the    directory   CGLE_EXAMPLES:  for  examples  and
  109.      templates.  To  get access to these files from the GLE menus
  110.      use the commands:
  111.  
  112.           $ define workarea sys$login:,cgle_examples:
  113.           $ set default workarea:
  114.           $ cgle stack4b.gle      ! or any other example 
  115.  
  116.      If  your keyboard doesn't have the function keys F9 thru F14
  117.      you  can  use GOLD (PF1) followed by the numbers 9,0,1,2,3,4
  118.      (on the top of the QWERTYUIOP keypad).
  119.  
  120.      Keyboard Mappings:
  121.  
  122.      VT100         VT200         PC         Meaning 
  123.      GOLD 1         F11         F1         Help 
  124.      GOLD 2         F12         F2         Save 
  125.      GOLD 3         F13         F3         Load 
  126.      GOLD 4         F14         F4         Save-as 
  127.      GOLD 9         F9         F9         Graph-menu 
  128.      GOLD 0         F10         F10         Draw-it 
  129.      Control+Z         Control+Z     Control+Z     Exit/Escape 
  130.                          Alt+X         Exit/Escape 
  131.      Control+E         Control+E             Calls VAX EDT 
  132.      Control+F         Control+F             Toggle fast/slow text 
  133.      Control+R         Control+R     F5         Shows errors 
  134.                          Control+S     Shells to DOS 
  135.  
  136.      Supported  devices:  VT100,  REGIS  (VT125, VT240), TEK4010,
  137.      VWS, XWindows.
  138.  
  139.      Supported  output:  PostScript, HPGL, Epson, Epson 24pin, HP
  140.      Deskjet.
  141.  
  142.      To  create  a PostScript output file (.PS) and automatically
  143.      print it to the LASER queue you would type:
  144.  
  145.           $ cgle myfile /print
  146.  
  147.      To  produce  an  .eps  file  for inclusion in LaTeXyou would
  148.      type:
  149.  
  150.           $ cgle myfile /dev=eps
  151.  
  152.      To  produce  a  .ps  file  suitable  for printing to a laser
  153.      writer type:
  154.  
  155.           $ cgle myfile /dev=ps
  156.  
  157.  It didn't work, bugs!!!
  158.  -----------------------
  159.      If  the  installation fails, or one of the example GLE files
  160.      fails  to  work then the most likely reason is a shortage of
  161.      memory  due to too many memory resident programs/drivers. To
  162.      fix  this  remove these utilities from your autoexec.bat and
  163.      config.sys files temporarily.
  164.  
  165.      There  may  well  be  a  bug in your GLE file, try using the
  166.      trace option to find the bug.
  167.      On a PC:
  168.  
  169.           C:\GLE> psgle myfile /trace
  170.  
  171.      On a VAX:
  172.  
  173.           $ cgle myfile /dev=ps /trace
  174.  
  175.      Another  reason for a failure is a bug in GLE, Please report
  176.      bugs    to   Chris  Pugmire  (in%"srghcxp@grv.dsir.govt.nz",
  177.      grv::srghcxp)  so  they  can  be fixed. If possible, try and
  178.      find  a way of repeating the problem, then send relevant GLE
  179.      and    data   files  with  an  outline  of  what  is  wrong.
  180.  
  181.  Drawing a Line on a Page
  182.  ------------------------
  183.      Let's  start  with  drawing  a  line on the page. GLE has to
  184.      know  what size piece of paper you are working with. You can
  185.      tell it by giving a size command:
  186.  
  187.           size 18 27
  188.  
  189.      This  specifies  a  piece  of paper 18cm wide and 27cm high.
  190.      Now  you  must define a current point by moving to somewhere
  191.      on the page:
  192.  
  193.           amove 2 4       
  194.  
  195.      The  origin  (0,0)  is at the bottom left hand corner of the
  196.      page.  Now  suppose  we  wish to draw a line from this point
  197.      across 1 cm and up 2 cm:
  198.  
  199.           size 18 27
  200.           amove 2 4
  201.           rline 1 2
  202.  
  203.      That  was  a  relative  movement  as the x and y values were
  204.      given  as distances from the current point, alternatively we
  205.      could have used absolute coordinates:
  206.  
  207.           size 18 27
  208.           amove 2 4
  209.           aline 3 6               ! absolute. 
  210.  
  211.      Now  if  you  want  to  draw  some  text on this page at the
  212.      current point you would use the text command:
  213.  
  214.           text Hi there
  215.  
  216.      So  we  have  now  constructed  an  entire  GLE  program  as
  217.      follows, with the results illustrated below:
  218.  
  219.           size 12 8 box 
  220.           amove 2 4
  221.           rline 1 2
  222.           text Hi there
  223.  
  224.  Drawing a Simple Graph
  225.  ----------------------
  226.      This  section will describe how to go about drawing a simple
  227.      graph.
  228.  
  229.      The  following  data  points  are contained in a file called
  230.      TUT.DAT
  231.  
  232.          x   y
  233.          -----  (These top two lines do not appear in the file)
  234.          1   2
  235.          2   6
  236.          3   2
  237.          4   5
  238.          5   9
  239.  
  240.      The  data is in two columns with white space separating each
  241.      column  of  numbers.  The  following  commands  will  draw a
  242.      simple line graph of the data.
  243.  
  244.          size 6 3 
  245.          begin graph
  246.             size 6 3 
  247.             data tut.dat
  248.             yaxis min 0 
  249.             d1 line marker star msize .2
  250.          end graph
  251.  
  252.      The  first  size  command  defines  the size of the piece of
  253.      paper  which  may contain several graphs. The second defines
  254.      the  size  of  this  particular graph. The actual graph axes
  255.      are  by  default  0.7  of these dimensions. The ratio can be
  256.      changed with the vscale and hscale commands.
  257.  
  258.      Without  the  "yaxis min 0" command the yaxis would start at
  259.      2.0,  because  that is the minimum y value in the data. This
  260.      makes the graph easier to interpret.
  261.  
  262.      Changing the above d1 command to:
  263.  
  264.          d1 line marker circle 
  265.  
  266.      will  mark  each data point with a circle instead of a star.
  267.      See    appendix   A  for  a  list  of  other  marker  names.
  268.  
  269.      A  smooth  line  can  be  drawn  between  the data points by
  270.      changing the d1 command to:
  271.  
  272.          d1 line marker circle smooth
  273.  
  274.      The  order  of  the  commands  is not important, except that
  275.      circle    is  a  parameter  for  the  qualifier  marker  and
  276.      therefore  must  come  straight after it. E.g.,  d1  [marker
  277.      circle]  [line smooth]  [color blue]
  278.  
  279.  GLE Primitives
  280.  --------------
  281.      A   GLE  command  is  a  sequence  of  keywords  and  values
  282.      separated  by white space (one or more spaces or tabs). Each
  283.      command  must  begin  on  a  new  line.  Keywords may not be
  284.      abbreviated,  the  case  is not significant. All coordinates
  285.      are  expressed in centimetres from the bottom left corner of
  286.      the page.
  287.  
  288.      GLE  uses the concept of a current point which most commands
  289.      use.  For  example,  the  command aline 2 3 will draw a line
  290.      from    the    current   point  to  the  coordinates  (2,3).
  291.  
  292.      The  current  graphics  state  also  includes other settings
  293.      like  line width, color, font, 2d transformation matrix. All
  294.      of these can be set with various GLE commands.
  295.  
  296.  Graphics Primitives (a summary)
  297.  -------------------------------
  298.      ! comment 
  299.      @ xxx 
  300.      aline x y [arrow start] [arrow end] [arrow both] 
  301.      amove x y 
  302.      arc radius a1 a2 
  303.      arcto x1 y1 x2 y2 rad 
  304.      begin box [fill pattern] [add gap] [nobox] [name xyz] 
  305.      begin clip 
  306.      begin origin 
  307.      begin path [stroke] [fill pattern] [clip] 
  308.      begin rotate angle 
  309.      begin scale x y 
  310.      begin table 
  311.      begin text [width exp] 
  312.      begin translate x y 
  313.      bezier x1 y1 x2 y2 x3 y3 
  314.      bigfile filename.gle 
  315.      box x y [justify jtype] [fill color] [name xxx] [nobox] 
  316.      circle radius [fill pattern] 
  317.      closepath 
  318.      curve ix iy [ x1 y1 x y x y ... xn yn] ex ey 
  319.      define marker markername subroutine-name 
  320.      for var = exp1 to exp2 [step exp3] command [...] next var 
  321.      grestore 
  322.      gsave 
  323.      if exp then command [...] else command [...] end if 
  324.      include filename 
  325.      join object1.just sep object2.just 
  326.      marker marker-name [ scale-factor] 
  327.      postscript filename.eps width-exp height-exp 
  328.      rbezier x1 y1 x2 y2 x3 y3 
  329.      return exp 
  330.      reverse 
  331.      rline x y [arrow end] [arrow start] [arrow both] 
  332.      rmove x y 
  333.      save objectname 
  334.      set cap butt | round | square 
  335.      set color col 
  336.      set dashlen dashlen-exp 
  337.      set font font-name 
  338.      set fontlwidth line-width 
  339.      set hei character-size 
  340.      set join mitre | round | bevel 
  341.      set just left | center | right | tl | etc... 
  342.      set lstyle line-style 
  343.      set lwidth line-width 
  344.      sub sub-name paramter1 paramter2 etc 
  345.      text unquoted-text-string 
  346.      write string$
  347.  
  348.  Graphics Primitives (in detail)
  349.  -------------------------------
  350.  
  351.  ! comment
  352.      Indicates  the  start  of  a comment. GLE ignores everything
  353.      from   the  exclamation  point  to  the  end  of  the  line.
  354.  
  355.  @ xxx
  356.      Executes subroutine xxx.
  357.  
  358.  aline x y [arrow start] [arrow end] [arrow both] 
  359.      Draws  a  line  from  the  current  point  to  the  absolute
  360.      coordinates  (x,y),  which  then  becomes  the  new  current
  361.      point.  The  arrow qualifiers are optional, they draw arrows
  362.      at  the  start  or end of the line, the size of the arrow is
  363.      proportional to the current font height.
  364.  
  365.  amove x y
  366.      Changes  the  current  point  to  the  absolute  coordinates
  367.      (x,y).
  368.  
  369.  arc radius a1 a2
  370.      Draws  an  arc  of a circle in the anti-clockwise direction,
  371.      centered  at  the  current point, of radius radius, starting
  372.      at  angle a1 and finishing at angle a2. Angles are specified
  373.      in  degrees.  Zero  degrees  is  at three o'clock and Ninety
  374.      degrees is at twelve o'clock.
  375.  
  376.           arc 1.2 20 45
  377.  
  378.      The  command  narc  is  identical  but  draws the arc in the
  379.      clockwise  direction.  This is important when constructing a
  380.      path.
  381.  
  382.  arcto x1 y1 x2 y2 rad
  383.      Draws  a  line  from  the  current  point to (x1,y1) then to
  384.      (x2,y2)  but  fits  an  arc  of  radius  rad joining the two
  385.      vectors    instead   of  a  vertex  at  the  point  (x1,y1).
  386.  
  387.  begin block_name ... end block_name
  388.      There  are  several  block  structured commands in GLE. Each
  389.      begin  must  have  a  matching  end. Blocks which change the
  390.      current  graphics  state (e.g. scale, rotate, clip etc) will
  391.      restore  whatever  they  change  at  the  end  of the block.
  392.      Indentation  is  optional but should be used to make the GLE
  393.      program easier to read.
  394.  
  395.  begin box [fill pattern] [add gap] [nobox] [name xyz] 
  396.      Draws  a  box  around  everything  between begin box and end
  397.      box.  The option add adds a margin of margin cm to each side
  398.      of  the  box  to  make the box slightly larger than the area
  399.      defined  by the graphics primitives in the begin box end box
  400.      group  (to  leave a gap around text for example). The option
  401.      nobox stops the box outline from being drawn.
  402.  
  403.      The  name  option saves the coordinates of the box for later
  404.      use with the join command.
  405.  
  406.  begin clip 
  407.      This  saves  the  current clipping region. A clipping region
  408.      is  an  arbitrary  path  made  from  lines  and curves which
  409.      defines  the  area  on which drawing can occur. This is used
  410.      to  undo  the  effect  of a clipping region defined with the
  411.      begin  path  command. See the example CLIP.GLE in appendix B
  412.      at the end of the manual.
  413.  
  414.  begin origin
  415.      This  makes  the  current point the origin. This is good for
  416.      subroutines    or  something  which  has  been  drawn  using
  417.      amove,aline.  Everything  between  the  begin origin and end
  418.      origin  can  be moved as one unit. The current point is also
  419.      saved and restored.
  420.  
  421.  begin path [stroke] [fill pattern] [clip] 
  422.      Initialises  the  drawing  of  a filled shape. All the lines
  423.      and  curves  generated  until the next end path command will
  424.      be  stored and then used to draw the shape. stroke draws the
  425.      outline  of  the  shape, fill paints the inside of the shape
  426.      in  the given color and clip defines the shape as a clipping
  427.      region  for  all  future  drawing. Clipping and filling will
  428.      only work on PostScript devices.
  429.  
  430.  begin rotate angle
  431.      The  coordinate  system  is rotated anti-clockwise about the
  432.      current  point by the angle angle (in degrees). For example,
  433.      to  draw a line of text running vertically up the page (as a
  434.      Y axis label, say), type:
  435.  
  436.  begin scale x y
  437.      Everything  between  the  begin  and  end  is  scaled by the
  438.      factors  x  and  y.  E.g.,  scale 2 3 would make the picture
  439.      twice as wide and three times higher.
  440.  
  441.  begin table 
  442.      This  module  is an alternative to the TEXT module. It reads
  443.      the  spaces and tabs in the source file and aligns the words
  444.      accordingly.  A single space between two words is treated as
  445.      a real space, not an alignment space.
  446.  
  447.      With  a  proportionally  spaced font columns will line up on
  448.      the  left  hand side but not on the right hand side. However
  449.      with  a  fixed pitch font, like tt, everything will line up.
  450.  
  451.  begin text [width exp] 
  452.      This  module displays multiple lines/paragraphs of text. The
  453.      block  of text is justified according to the current justify
  454.      setting.  See  the  set  just  command  for a description of
  455.      justification settings.
  456.  
  457.      If  a  width  is specified the text is wrapped and justified
  458.      to  the  given  width. If a width is not given, each line of
  459.      text  is  drawn as it appears in the file. Remember that GLE
  460.      treats  text  in  the  same  way that LaTeXdoes, so multiple
  461.      spaces    are  ignored  and  some  characters  have  special
  462.      meaning. E.g, \ ^ _ & { }
  463.  
  464.      To  include  Greek  characters  in  the middle of text use a
  465.      backslash  followed  by  the  name  of the character. E.g., 
  466.      3.3\Omega S would produce ``3.3OS''.
  467.  
  468.      To  put  a space between the Omega and the S add a backslash
  469.      space  at  the  end. E.g.,  3.3\Omega\ S produces ``3.3O S''
  470.  
  471.      Sometimes  the  space  control characters (e.g. \:) are also
  472.      ignored,  this  may  happen  at  the  beginning of a line of
  473.      text.  In  this  case  use  the control sequence \glasswhich
  474.      will  trick GLE into thinking it isn't at the beginning of a
  475.      line. E.g.,
  476.  
  477.           text \glass \:\: Indented text
  478.  
  479.      There  are  several  LaTeXlike  commands  which  can be used
  480.      within text, they are:
  481.  
  482.          ^{}                 Superscript
  483.          _{}                 Subscript
  484.          \\                  Forced Newline
  485.          \_                  Underscore character
  486.          \,                  .5em (em = width of the letter `m')
  487.          \:                  1em space
  488.          \;                  2em space
  489.          \char{22}           Any character in current font
  490.          \chardef{a}{hello}  Define a character as a macro
  491.          \def\v{hello}       Defines a macro
  492.          \movexy{2}{3}       Moves the current text point
  493.          \glass              Makes move/space work on beginning of line
  494.          \rule{2}{4}         Draws a filled in box, 2cm by 4cm
  495.          \setfont{rmb}       Sets the current text font
  496.          \sethei{.3}         Sets the font height (in cm)
  497.          \setstretch{2}      Scales the quantity of glue between words
  498.          \lineskip{.1}       Sets the default distance between lines of text
  499.          \linegap{-1}        Sets the minimum required gap between lines 
  500.  
  501.  begin translate x y
  502.      Everything  between  the  begin  and end is moved x units to
  503.      the right and y units up.
  504.  
  505.  bezier x1 y1 x2 y2 x3 y3
  506.      Draws  a  Bezier cubic section from the current point to the
  507.      point  (x3,y3)  with  Bezier  cubic  control  points  at the
  508.      coordinates  (x1,y1)  and (x2,y2). For a full explanation of
  509.      Bezier  curves see the PostScript Language Reference Manual.
  510.  
  511.  bigfile filename.gle
  512.      This  command  reads  the  file one line at a time, compiles
  513.      each  line and executes it. This means it can read any sized
  514.      file.  However,  complex multi-line commands cannot be used.
  515.      Subroutines   can  be  used  but  not  defined,  inside  the
  516.      bigfile.  Note:  there  is  also  a  bigfile  option  in the
  517.      graphing module for large datasets.
  518.  
  519.  box x y [justify jtype] [fill color] [name xxx] [nobox] 
  520.      Draws  a  box, of width x and height y, with its bottom left
  521.      corner  at the current point. If the justify option is used,
  522.      the  box will be positioned relative to the specified point.
  523.      E.g.,  TL  = top left, CC = center center, BL = bottom left,
  524.      CENTRE  = bottom centre, RIGHT = bottom right, LEFT = bottom
  525.      left.  See  set  just  for  a  description  of justification
  526.      settings.
  527.  
  528.      If  a  fill  pattern  is  specified, the box will be filled.
  529.      Remember  that  white fill is different from no fill pattern
  530.      -  white  fill  will erase anything that was inside the box.
  531.  
  532.  circle radius [fill pattern] 
  533.      Draws  a circle at the current point, with radius radius. If
  534.      a  fill  pattern  is  specified  the  circle will be filled.
  535.  
  536.  closepath 
  537.      Joins  the  beginning  of a line to the end of a line. I.e.,
  538.      it does an aline to the end of the last amove.
  539.  
  540.  curve ix iy [ x1 y1 x y x y ... xn yn] ex ey 
  541.      Draws  a  curve  starting  at  the current point and passing
  542.      through  the  points  (x1,y1) (xn,yn), with an initial slope
  543.      of  (ix,iy) to (x1,y1) and a final slope of (ex,ey). All the
  544.      vectors  are  relative  movements  from  the  vector before.
  545.  
  546.  define marker markername subroutine-name
  547.      This  defines a new marker called markername which will call
  548.      the  subroutine  subroutine-name  whenever  it  is  used. It
  549.      passes  two  parameters,  the first is the requested size of
  550.      the  marker  and  the  second  is  a  value from a secondary
  551.      dataset  which  can  be  used  to vary size or rotation of a
  552.      marker for each point plotted.
  553.  
  554.  for var = exp1 to exp2 [step exp3] command [...] next var 
  555.      The  for  ...  next  structure  lets  you  repeat a block of
  556.      statements a number of times.
  557.  
  558.      GLE  sets  var  equal to exp1 and then repeats the following
  559.      steps.
  560.  
  561.      If  var  is  greater than exp2 then GLE commands are skipped
  562.      until the line after the next statement.
  563.  
  564.      The value exp3 is added to var.
  565.  
  566.      The  statements  between  the  for  and  next  statement are
  567.      executed. itemize
  568.  
  569.      If  exp1 is greater than exp2 then the loop is not executed.
  570.  
  571.  grestore
  572.      Restores  the  most  recently  saved graphics state. This is
  573.      the  simplest  way  to  restore  complicated transformations
  574.      such  as  rotations and translations. It must be paired with
  575.      a previous gsave command.
  576.  
  577.  gsave
  578.      Saves  the  current  graphics  transformation matrix and the
  579.      current point and the current color, font etc.
  580.  
  581.  if expression then command [...] else command [...] end if
  582.      If  expression  evaluates  to true, then execution continues
  583.      with  the statements up to the corresponding else, otherwise
  584.      the statements following the else and up to the
  585.      corresponding end if are executed.
  586.  
  587.           amove 3 3
  588.           if xpos()=3 then
  589.              text We are at x=3
  590.           else
  591.              text We are elsewhere
  592.           end if
  593.  
  594.      Note: end if is not spelt endif.
  595.  
  596.  include filename
  597.      The  commands  in  filename are read just as if they were in
  598.      the  current GLE file. With a large include file GLE may run
  599.      out  of  memory.  If  this  happens, use the bigfile command
  600.      instead  of include. Note: there is also a bigfile option in
  601.      the graphing module.
  602.  
  603.  join object1.just sep object2.just 
  604.      Draws  a line between two named objects. An object is simply
  605.      a  point  or a box which was given a name when it was drawn.
  606.  
  607.      The  justify  qualifiers  are the standard GLE justification
  608.      abbreviations  (e.g.  TL=top left, see set just for details)
  609.  
  610.      If  sep  is  written as -, a line is drawn between the named
  611.      objects e.g.
  612.  
  613.           join fred.tr - mary.tl
  614.  
  615.      Arrow  heads  can  be  included  at both ends of the line by
  616.      writing  sep  as  <->. Single arrow heads are produced by <-
  617.      and  ->.  Note  that sep must be separated from object1.just
  618.      and object2.just by white space.
  619.  
  620.      If  the justification qualifiers are omitted, a line will be
  621.      drawn  between  the  centres  of the two objects (clipped at
  622.      the  edges  of  the  rectangles  which  define the objects).
  623.  
  624.      See    Chapter    5  for  an  example  of  joining  objects.
  625.  
  626.  marker marker-name [ scale-factor] 
  627.      Draws  marker  marker-name at the current point. The size of
  628.      the  marker is proportional to the current font size, scaled
  629.      by  the  value  of  scale-factor  if  present.  Markers  are
  630.      referred  to  by  name,  eg.  square,  diamond, triangle and
  631.      fcircle.  Markers  beginning  with  the letter f are usually
  632.      filled  variants.  Markers  beginning with w are filled with
  633.      white  so  lines  are  not visible through the marker. For a
  634.      complete list of markers refer to Appendix A.1.
  635.  
  636.  postscript filename.eps width-exp height-exp 
  637.      Includes    an  encapsulated  postscript  file  into  a  GLE
  638.      picture,  the  postscript  picture will be scaled up or down
  639.      to  fit  the  width given. On the screen you will just see a
  640.      rectangle.
  641.  
  642.      Only  the width-exp is used to scale the picture so that the
  643.      aspect  ratio  is  maintained.  The  height  is only used to
  644.      display  a  rectangle  of  the  right  size  on  the screen.
  645.  
  646.  rbezier x1 y1 x2 y2 x3 y3
  647.      This  command is identical to the BEZIER command except that
  648.      the    points   are  all  relative  to  the  current  point.
  649.  
  650.  return exp
  651.      The  return  command  is used inside subroutines to return a
  652.      value.
  653.  
  654.  reverse 
  655.      Reverses  the  direction  of  the current path. This is used
  656.      when  filling  multiple  paths  in  order  that the Non-Zero
  657.      Winding  Rule  will know which part of the path is `inside'.
  658.  
  659.      With  the  Non-Zero  Winding Rule an imaginary line is drawn
  660.      through  the object. Every time a line of the object crosses
  661.      it  from  left  to right, one is added to the counter; every
  662.      time  a  line  of  the object crosses it from right to left,
  663.      one  is  subtracted from the counter. Everywhere the counter
  664.      is  non-zero is considered to be the `inside' of the drawing
  665.      and is filled.
  666.  
  667.  rline x y [arrow end] [arrow start] [arrow both] 
  668.      Draws  a  line  from  the  current  point  to  the  relative
  669.      coordinates  (x,y), which then become the new current point.
  670.      If  the current point is (5,5) then rline 3 -2 is equivalent
  671.      to  aline  8  3.  The  optional qualifiers on the end of the
  672.      command  will  draw  arrows at one or both ends of the line,
  673.      the  size  of  the arrow head is proportional to the current
  674.      font size.
  675.  
  676.  rmove x y
  677.      Changes  the current point to the relative coordinate (x,y).
  678.      If  the current point is (5,5) then rmove 3 -2 is equivalent
  679.      to amove 8 3.
  680.  
  681.  save objectname 
  682.      This  command  saves  a  point  for  later use with the join
  683.      command.
  684.  
  685.  set cap butt | round | square
  686.      Defines what happens at the end of a wide line.
  687.  
  688.  set color col
  689.      Sets  the  current  color for all future drawing operations.
  690.      There  are several pre-defined colors which can be specified
  691.      by name.
  692.  
  693.      black,  white,  red,  green,  blue,  cyan,  magenta, yellow,
  694.      grey10,  grey20  ...  grey90,  shade1  ... shade5, grid1 ...
  695.      grid5
  696.  
  697.      It   is  also  possible  to  specify  a  grey  scale  as  an
  698.      expression with 0.0 = black and 1.0 = white.
  699.  
  700.  set dashlen dashlen-exp
  701.      Sets  the  length  of  the  smallest  dash used for the line
  702.      styles.  This  command  MUST  come  before  the  set  lstyle
  703.      command.  This  may  be  needed  when scaling a drawing by a
  704.      large factor.
  705.  
  706.  set font font-name
  707.      Sets  the  current  font  to font-name. Valid font-names are
  708.      listed in Appendix A.2.
  709.  
  710.      There    are  three  types  of  font:  PostScript,  LaTeXand
  711.      Plotter.    They  will  all  work  on  any  device,  however
  712.      LaTeXfonts  are  drawn  in  outline on a plotter, and so may
  713.      not  look  very  nice.  PostScript fonts will be emulated by
  714.      LaTeXfonts on non-PostScript printers.
  715.  
  716.  set fontlwidth line-width
  717.      This  sets the width of lines to be used to draw the stroked
  718.      (Plotter  fonts)  on  a PostScript printer. This has a great
  719.      effect on their appearance.
  720.  
  721.  set hei character-size
  722.      Sets  the height of text. For historical reasons, concerning
  723.      lead  type  and  printing  conventions,  a  height  of  10cm
  724.      actually  results  in  capital  letters  about  6.5cm  tall.
  725.  
  726.  set join mitre | round | bevel 
  727.      Defines  how  two  wide  lines will be joined together. With
  728.      mitre,  the  outside  edges  of  the  join are extended to a
  729.      point  and  then  chopped off at a certain distance from the
  730.      intersection  of the two lines. With round, a curve is drawn
  731.      between the outside edges.
  732.  
  733.  set just left | center | right | tl | etc... 
  734.  
  735.      Sets    the  justification  which  will  be  used  for  text
  736.      commands.
  737.  
  738.  set lstyle line-style
  739.      Sets    the    current  line  style  to  line  style  number
  740.      line-style.  There are 9 predefined line styles (1--9). When
  741.      a  line  style  is  given with more than one digit the first
  742.      digit  is  read  as  a run length in black, the second a run
  743.      length  in  white,  the  third  a  run length in black, etc.
  744.  
  745.  set lwidth line-width
  746.      Sets  the  width  of lines to line-width cm. A value of zero
  747.      will  result  in  the  device default of about 0.02 cm, so a
  748.      lwidth  of  .0001  gives a thinner line than an lwidth of 0.
  749.  
  750.  sub sub-name parameter1 parameter2 etc
  751.      Defines  a  subroutine. The end of the subroutine is denoted
  752.      with  end  sub.  Subroutines must be defined before they are
  753.      used.
  754.  
  755.      Subroutines  can  be  called  inside any GLE expression, and
  756.      can  also  return  values.  The  parameters  of a subroutine
  757.      become    local    variables.   Subroutines  are  reentrant.
  758.  
  759.           sub tree x y a$
  760.              amove x y
  761.              rline 0 1
  762.              write a$
  763.              return x/y
  764.           end sub
  765.           @tree 2 4 "mytree"         (Normal call to subroutine)
  766.           slope = tree(2,4,"mytree")  (Using subroutine in an expression)
  767.  
  768.  text unquoted-text-string
  769.      This  is  the simplest command for drawing text. The current
  770.      point  is  unmodified  after  the text is drawn so following
  771.      one  text  command  with  another  will result in the second
  772.      line  of  text  being drawn on top of the first. To generate
  773.      multiple  lines  of  text,  use  the  begin  text  end  text
  774.      construct.
  775.  
  776.           text "Hi, how's tricks", said Jack!
  777.  
  778.  write string$
  779.      This  command  is  similar  to text except that it expects a
  780.      quoted  string,  string  variable, or string expression as a
  781.      parameter.
  782.  
  783.      The  built  in functions sqrt() and time$() are described in
  784.      appendix A.3.
  785.  
  786.      commanddescription
  787.  
  788.  Expressions
  789.  -----------
  790.      Wherever  GLE  is expecting a number it can be replaced with
  791.      an expression. For example
  792.  
  793.           rline 3 2
  794.  
  795.      and
  796.  
  797.           rline 9/3 sqrt(4)
  798.  
  799.      will produce the same result.
  800.  
  801.      An  expression in GLE is delimited by white space, so it may
  802.      not  contain  any  spaces  -  `  rline 3*3 2' is valid but `
  803.      rline 3 * 3 2' will not work.
  804.  
  805.      Or  `  let  d2  =  3+sin(d1)'  will  work  and ` let d2= 3 +
  806.      sin(d1) ' won't.
  807.  
  808.      Expressions  may  contain numbers, arithmetic operators ( +,
  809.      -,  *,  /, ^(to the power of)), relational operators ( >, <,
  810.      =>,  <=,  =, <>) boolean operators ( AND, OR), variables and
  811.      built-in functions.
  812.  
  813.      When  GLE  is expecting a color or marker name (like `green'
  814.      or  `circle')  it  can  be  given  a  string variable, or an
  815.      expression enclosed in braces).
  816.  
  817.      GLE  provides  a  large  number of built in functions, these
  818.      are listed in Appendix A.3.
  819.  
  820.  Functions Inside Expressions
  821.  ----------------------------
  822.  
  823.  xg(), yg()
  824.      With  these  functions  it is possible to move to a position
  825.      on  a  graph  using the graph's axis units. To draw a filled
  826.      box  on  a  graph, at position x=948, y=.004 measured on the
  827.      graph axis:
  828.  
  829.           begin graph
  830.              xaxis min 100 max 2000
  831.              yaxis min -.01 max .01
  832.              ...
  833.           end graph
  834.           amove xg(948) yg(.004)
  835.           box 2 2 fill grey10 
  836.  
  837.  xend(), yend()
  838.      These  functions  return  the  end  point  of the last thing
  839.      drawn.  This  is  of  particular interest when drawing text.
  840.  
  841.           text abc
  842.           set color blue
  843.           text def      
  844.  
  845.      This  would  draw the def on top of the abc. To draw the def
  846.      immediately  following the abc simply do the following (Note
  847.      that absolute move is used, not relative move):
  848.  
  849.  xpos(), ypos()
  850.      Returns  the  current  x  and  y  points. commanddescription
  851.  
  852.  The Graph Module
  853.  ----------------
  854.      A  graph  should  start  with  begin  graph and end with end
  855.      graph.  The  data to be plotted are organised into datasets.
  856.      A  dataset  consists  of  a series of (X,Y) coordinates, and
  857.      has  a name based on the letter ``d'' and a number between 1
  858.      and 99, eg. d1
  859.  
  860.      The  name  dn  can  be  used  to  define  a  default for all
  861.      datasets.  Many  graph commands described below start with d
  862.      n.  This  would  normally  be replaced by a specific dataset
  863.      number e.g.,
  864.  
  865.           d3 marker diamond
  866.  
  867.      For  each  xaxis  command  there  is  a corresponding yaxis,
  868.      y2axis  and  x2axis  command  for  setting  the top left and
  869.      right    hand   axes.  These  commands  are  not  explicitly
  870.      mentioned in the following descriptions.
  871.  
  872.  Graph Commands (a summary)
  873.  --------------------------
  874.      data filename [d1 d2 d3 ... ] [d1=c1,c3 ] 
  875.      dn bigfile "all.dat,xc,yc" [marker mname] [line] 
  876.      dn err d5 errwidth width-exp errup nn% errdown d4 
  877.      dn herr d5 herrwidth width-exp herrleft nn% errright d4 
  878.      dn key "Dataset title" 
  879.      dn line
  880.      dn lstyle line-style lwidth line-width color col 
  881.      dn marker marker-name [msize marker-size] [mdata dn] 
  882.      dn nomiss 
  883.      dn smooth | smoothm 
  884.      dn xmin x-low xmax x-high ymin y-low ymax y-high 
  885.      fullsize 
  886.      hscale exp 
  887.      key pos tl nobox hei exp offset xexp yexp 
  888.      let ds = exp [from low to high step exp ] 
  889.      nobox 
  890.      size x y 
  891.      title  "title"  [hei  ch-hei]  [color col] [font font] [dist
  892.      cm] 
  893.      vscale exp 
  894.      x2labels on 
  895.      xaxis | yaxis | x2axis | y2axis
  896.      xaxis color col font font-name hei exp-cm lwidth exp-cm 
  897.      xaxis dsubticks sub-distance 
  898.      xaxis grid 
  899.      xaxis log 
  900.      xaxis min low max high dpoints n 
  901.      xaxis nofirst nolast 
  902.      xaxis nticks number dticks distance 
  903.      xaxis off 
  904.      xaxis shift cm-exp 
  905.      xlabels font font-name hei char-hei color col 
  906.      xnames "name" "name" ... 
  907.      xplaces pos1 pos2 pos3 ... 
  908.      xside color col lwidth line-width off 
  909.      xsubticks lstyle num lwidth exp length exp off 
  910.      xticks lstyle num lwidth exp length exp off 
  911.      xtitle  "title"  [hei  ch-hei] [color col] [font font] [dist
  912.      cm] 
  913.      y2title "text-string" [rotate]
  914.  
  915.      bar dx,... dist spacing
  916.      bar dx,... from dy,...
  917.      bar dn,... width xunits,... fill col,... color col,... 
  918.  
  919.      fill x1, d3 color green xmin val xmax val 
  920.      fill d4,x2 color blue ymin val ymax val 
  921.      fill d3,d4 color green xmin val xmax val 
  922.      fill d4 color green xmin val xmax val 
  923.  
  924.  Graph Commands (in detail)
  925.  --------------------------
  926.  
  927.  data filename [d1 d2 d3 ... ] [d1=c1,c3 ] 
  928.      Specifies  the name of a file to read data from. By default,
  929.      the  data  will  be  read into the next free datasets unless
  930.      the    optional    specific  dataset  names  are  specified.
  931.  
  932.      A  dataset  consists  of  a series of (X,Y) coordinates, and
  933.      has  a name based on the letter d and a number between 1 and
  934.      99,  e.g.  d1  or  d4.  Up  to  99  datasets may be defined.
  935.  
  936.      From  a file with 3 columns the command ` data xx.dat' would
  937.      read  the first and second columns as the x and y values for
  938.      dataset  1 (d1) and the first and third columns as the x and
  939.      y  values  for  dataset  2 (d2). The next data command would
  940.      use dataset 3 (d3).
  941.  
  942.      A  data  file  for  two  datasets looks like this (*=missing
  943.      value):
  944.  
  945.          1  2.7   3
  946.          2  5     *
  947.          3  7.8   7
  948.          4  9     4
  949.  
  950.      The  first  coordinate  of dataset d1 would then be ( 1,2.7)
  951.      and  the  first  coordinate  of  dataset d2 would be ( 1,3).
  952.  
  953.      The  option d3=c2,c3 allows particular columns of data to be
  954.      read  into  a  dataset, d3 would read x values from column 2
  955.      and y values from column 3.
  956.  
  957.  dn bigfile "all.dat,xc,yc" [marker mname] [line] 
  958.      The  bigfile  option  allows  a  dataset to be read as it is
  959.      drawn,  (rather  than being complete read into memory before
  960.      it  is  drawn)  this  means  that very large datasets can be
  961.      drawn  on  a  PC  without  running  out  of memory. The axis
  962.      minimum  and  maximum  must  be specified (using the command
  963.      xaxis min exp max exp.
  964.  
  965.      By  default  the  first two columns of the data file will be
  966.      read    in,  but  other  columns  may  be  specified.  E.g.,
  967.      all.dat,3,2  would  read x values from column 3 and y values
  968.      from  column  2.  Or,  to  read the 4th dataset, specify the
  969.      file as all.dat,1,5
  970.  
  971.      If  the  x column is specified as '0' then GLE will generate
  972.      the x data points. E.g., 1,2,3,4,5...
  973.  
  974.      Many  (but  not  all)  of the normal dn commands can be used
  975.      with  the bigfile command. E.g., marker, lstyle, xmin, xmax,
  976.      ymin,  ymax,  color and lwidth. You cannot use commands like
  977.      let or bar with the bigfile command.
  978.  
  979.  dn err d5 errwidth width-exp dn errup nn% errdown d4 
  980.      For  drawing  error  bars  on a graph. The error bars can be
  981.      specified  as  an  absolute  value, as a percentage of the y
  982.      value,  or  as  a dataset. The up and down error bars can be
  983.      specified separately e.g.,
  984.  
  985.           d3 err .1
  986.           d3 err 10%
  987.           d3 errup 10% errdown d2
  988.           d3 err d1 errwidth .2
  989.  
  990.  dn herr d5 herrwidth width-exp dn herrleft nn% errright d4 
  991.      These  commands  are  identical  to  the  error bar commands
  992.      above  except  that  they  will  draw bars in the horizontal
  993.      plane.
  994.  
  995.  dn key "Dataset title" 
  996.      If  a  dataset  is  given  a  title  like this a key will be
  997.      drawn.  Use the key command (below, after hscale) to set the
  998.      size  and  position  of the key. Use the key module (Chapter
  999.      4) to draw more complex keys.
  1000.  
  1001.  dn line
  1002.      This  tells  GLE  to  draw  lines  between the points of the
  1003.      dataset.  By  default  GLE  will  not draw lines or markers,
  1004.      this is often the reason for a blank graph.
  1005.  
  1006.      If  a dataset has missing values GLE will not draw a line to
  1007.      the  next  real  value,  which leaves a gap in the curve. To
  1008.      avoid  this  behavior simply use the nomiss qualifier on the
  1009.      dn  command used to define the line. This simply throws away
  1010.      missing  values  so  that lines are drawn from the last real
  1011.      value to the next real value.
  1012.  
  1013.  dn lstyle line-style lwidth line-width color col 
  1014.      These  qualifiers  are  all fairly self explanatory. See the
  1015.      lstyle  command  in Chapter~2 for details of specifying line
  1016.      styles.
  1017.  
  1018.  dn marker marker-name [msize marker-size] [mdata dn] 
  1019.      Specifies  the marker to be used for the dataset. There is a
  1020.      set  of  pre-defined  markers  (refer  to Appendix A.1 for a
  1021.      list)  which can be specified by name (e.g., circle, square,
  1022.      triangle,  diamond,  cross,  ...).  Markers  can  also  be a
  1023.      user-defined  subroutine  (See  the define marker command in
  1024.      Chapter  2).  The mdata option allows a secondary dataset to
  1025.      be  defined  which will be used to pass another parameter to
  1026.      the  marker  subroutine, this allows each marker to be drawn
  1027.      at a different angle,size or color.
  1028.  
  1029.      The  msize  qualifier sets the marker size for that dataset.
  1030.      The  size  is  a  character height in cm, so that the actual
  1031.      size  of  the  markers  will  be  about  0.7  of this value.
  1032.  
  1033.  dn nomiss 
  1034.      If  a  dataset  has missing values, GLE will not draw a line
  1035.      to  the next real value, which leaves a gap in the curve. To
  1036.      avoid  this  behavior simply use the nomiss qualifier on the
  1037.      dn  command  used  to  define  the line. This simply ignores
  1038.      missing values.
  1039.  
  1040.  dn smooth | smoothm 
  1041.      This  will make GLE draw a smoothed line through the points.
  1042.      A  third  degree polynomial is fitted piecewise to the given
  1043.      points.
  1044.  
  1045.      The    smoothm   alternative  will  work  for  multi  valued
  1046.      functions,  i.e., functions which have more than one y value
  1047.      for each x value.
  1048.  
  1049.  dn xmin x-low xmax x-high ymin y-low ymax y-high 
  1050.      These  commands map the dataset onto the graph's boundaries.
  1051.      The  data  will  be drawn as if the X axis was labelled from
  1052.      x-low  to  x-high  (regardless  of  how the axis is actually
  1053.      labelled).  A  point in the dataset at X = x-low will appear
  1054.      on the left hand edge of the graph.
  1055.  
  1056.  fullsize 
  1057.      This  is  equivalent  to  vscale  1,  hscale 1, noborder. It
  1058.      makes  the  graph size command specify the size and position
  1059.      of  the  axes  instead  of  the  size of the outside border.
  1060.  
  1061.  hscale exp 
  1062.      Scales  the  length  of  the  yaxis. See vscale. The default
  1063.      value is 0.7.
  1064.  
  1065.  key pos tl nobox hei exp offset xexp yexp 
  1066.      This  command  allows the features of a key to be specified.
  1067.      The  pos  qualifier  sets  the  position  of  the key. E.g.,
  1068.      tl=topleft, br=bottomright, etc.
  1069.  
  1070.  let ds = exp [ from low to high step exp ] 
  1071.      This  command  defines  a  new  dataset  as the result of an
  1072.      expression  on  the  variable  x  over a range of values. It
  1073.      also  allows the use of other datasets. E.g., to generate an
  1074.      average of two datasets:
  1075.  
  1076.           data aa.dat d1 d2
  1077.           let d3 = d1+d2/2
  1078.  
  1079.      Or to generate data from scratch:
  1080.  
  1081.           let d1 = sin(x)+log(x) from 1 to 100 step 1
  1082.  
  1083.      If  the  xaxis is a LOG axis then the step option is read as
  1084.      the  number of steps to produce rather than the size of each
  1085.      step.
  1086.  
  1087.      NOTE:  The  spacing  around  the  `='  sign  and the lack of
  1088.      spaces inside the expression are necessary.
  1089.  
  1090.  nobox 
  1091.      This removes the outer border from the graph.
  1092.  
  1093.  size x y 
  1094.      Defines  the  size  of  the graph in cm. This is the size of
  1095.      the  outside box of a graph. The default size of the axes of
  1096.      the  graph  will  be  70%  of this, (see vscale and hscale).
  1097.      This command is required.
  1098.  
  1099.      title  "title"  [hei  ch-hei]  [color col] [font font] [dist
  1100.  cm] 
  1101.      This  command  gives  the graph a centred title. The list of
  1102.      optional   keywords  specifies  features  of  it.  The  dist
  1103.      command    is   used  for  moving  the  title  up  or  down.
  1104.  
  1105.  vscale exp 
  1106.      This  sets  the  width  of the axis relative to the width of
  1107.      the  graph.  For example with a 10cm wide graph and a vscale
  1108.      of  .6  the x axis would be 6cm long. A setting of 1.0 makes
  1109.      the  xaxis  the same length as the width of the graph, which
  1110.      is  useful for positioning some graphs. The default value is
  1111.      0.7.
  1112.  
  1113.  x2labels on 
  1114.      This  command `activates' the numbering of the x2axis. There
  1115.      is  a corresponding command ` y2axis on' which will activate
  1116.      y2axis numbering.
  1117.  
  1118.  xaxis | yaxis | x2axis | y2axis
  1119.      A  graph  is  considered to have four axes: The normal xaxis
  1120.      and  yaxis  as  well  as the top axis (x2axis) and the right
  1121.      axis (y2axis).
  1122.  
  1123.      Any  command defining an xaxis setting will also define that
  1124.      setting for the x2axis.
  1125.  
  1126.      The  secondary  axes  x2 and y2 can be modified individually
  1127.      by  starting  the  axis  command with the name of that axis.
  1128.      E.g.,
  1129.  
  1130.  xaxis color col font font-name hei exp-cm lwidth exp-cm 
  1131.      These  axis qualifiers affect the color, lstyle, lwidth, and
  1132.      font  used for drawing the xaxis (and the x2axis). These can
  1133.      be  overriden  with  more  specific commands. E.g., ` xticks
  1134.      color  blue'  would override the axis color when drawing the
  1135.      ticks.  The subticks would also be blue as they pick up tick
  1136.      settings by default.
  1137.  
  1138.  xaxis dsubticks sub-distance 
  1139.      See xaxis nticks below.
  1140.  
  1141.  xaxis grid 
  1142.      This  command makes the xaxis ticks long enough to reach the
  1143.      x2axis  and the yaxis ticks long enough to reach the y2axis.
  1144.      When  used  with  both the x and y axes this produces a grid
  1145.      over  the  graph.  Use the xticks lstyle command to create a
  1146.      faint grid.
  1147.  
  1148.  xaxis log 
  1149.      Draws  the  axis  in  logarithmic style, and scales the data
  1150.      logarithmically  to  match  (on the x2axis or y2axis it does
  1151.      not  affect  the  data, only the way the ticks and labelling
  1152.      are drawn)
  1153.  
  1154.      Be  aware  that  a  straight  line should become curved when
  1155.      drawn  on  a  log  graph.  This will only happen if you have
  1156.      enough points or have used the smooth option.
  1157.  
  1158.  xaxis min low max high dpoints n 
  1159.      Sets  the minimum and maximum values on the xaxis. This will
  1160.      determine  both  the  labelling  of the axis and the default
  1161.      mapping  of  data  onto the graph. To change the mapping see
  1162.      the   dataset  dn  commands  xmin,  ymin,  xmax,  and  ymax.
  1163.  
  1164.      The  dpoints  option  specifies the number of decimal points
  1165.      that  should  be  displayed.  e.g.  with  a value of 3 these
  1166.      numbers  (0,  0.333333,  0.6666667,  1) would become (0.000,
  1167.      0.333, 0.667, 1.000)
  1168.  
  1169.  xaxis nofirst nolast 
  1170.      These  two  switches  simply  remove  the  first or last (or
  1171.      both)  labels  from the graph. This is useful when the first
  1172.      labels  on  the  x  and  y axis are too close to each other.
  1173.  
  1174.  xaxis nticks number dticks distance 
  1175.      nticks  specifies the number of ticks along the axis. dticks
  1176.      specifies    the    distance  between  ticks  and  dsubticks
  1177.      specifies  the  distance  between  subticks. For example, to
  1178.      get  one subtick between every main tick with main ticks 3cm
  1179.      apart, simply specify dsubticks 1.5.
  1180.  
  1181.      By  default  ticks  are drawn on the inside of the graph. To
  1182.      draw them on the outside use the command:
  1183.  
  1184.           xticks length -.2
  1185.           yticks length -.2
  1186.  
  1187.  xaxis off 
  1188.      Turns  the  whole  axis  off --- labels, ticks, subticks and
  1189.      line.  Often  the  x2axis  and y2axis are not required, they
  1190.      could    be    turned   off  with  the  following  commands:
  1191.  
  1192.           x2axis off
  1193.           y2axis off
  1194.  
  1195.  xaxis shift cm-exp 
  1196.      This  moves  the  labelling  to  the left or right, which is
  1197.      useful  when  the  label  refers to the data between the two
  1198.      values.
  1199.  
  1200.  xlabels font font-name hei char-hei color col 
  1201.      This  command controls the appearance of the axis labels but
  1202.      not the axis title.
  1203.  
  1204.  xnames "name" "name" ... 
  1205.      This  command replaces the numeric labelling with absolutely
  1206.      anything.  Given data consisting of five measurements, taken
  1207.      from Monday to Friday, one per day then
  1208.  
  1209.           xaxis min 0 max 6 dticks 1
  1210.           xnames "" "Mon" "Tue" "Wed" "Thu" "Fri"  ""
  1211.  
  1212.      would  give  the  desired  result.  Note  it is essential to
  1213.      define  a  specific  axis  minimum,  maximum,  dticks, etc.,
  1214.      otherwise  the  labels  may  not  correspond  to  the  data.
  1215.  
  1216.      If  there  isn't  enough  room on the line for all the names
  1217.      then simply use an extra xnames command.
  1218.  
  1219.  xplaces pos1 pos2 pos3 ... 
  1220.      This  is  similar  to  the xnames command but it specifies a
  1221.      list  of  points  which  should  be  labelled.  This  allows
  1222.      labelling  which  isn't  equally  spaced.  The above example
  1223.      with    days  of  the  week  could  be  written  like  this:
  1224.  
  1225.           xplaces 1  2  5
  1226.           xplaces 7
  1227.           xnames "Mon" "Tue" "Fri" "Sun"
  1228.       
  1229.  
  1230.      If  there  isn't  enough  room on the line for all the names
  1231.      then simply use an extra xplaces command.
  1232.  
  1233.  xside color col lwidth line-width off 
  1234.      This  command controls the appearance of the axis line, i.e.
  1235.      the line to which the ticks are attached.
  1236.  
  1237.  xsubticks lstyle num lwidth exp length exp off 
  1238.      This  command  gives  fine  control of the appearance of the
  1239.      axis subticks.
  1240.  
  1241.  xticks lstyle num lwidth exp length exp off 
  1242.      This  command  gives  fine  control of the appearance of the
  1243.      axis  ticks. Note: To get ticks on the outside of the graph,
  1244.      i.e.  pointing  outwards,  specify  a  negative tick length:
  1245.  
  1246.           xticks length -.2
  1247.           yticks length -.2
  1248.  
  1249.      xtitle  "title"  [hei  ch-hei] [color col] [font font] [dist
  1250.  cm] 
  1251.      This  command  gives  the axis a centered title. The list of
  1252.      optional  keywords  specify features of it. The dist command
  1253.      is used for moving the title up or down.
  1254.  
  1255.  y2title "text-string" [rotate] 
  1256.      By  default  the  y2title is written vertically upwards. The
  1257.      optional    rotate    keyword   changes  this  direction  to
  1258.      downwards.  The  rotate  option  is  specific to the y2title
  1259.      command.
  1260.  
  1261.      commanddescription
  1262.  
  1263.  Bar Graphs
  1264.  ----------
  1265.      Drawing  a  bar  graph  is  a subcommand of the normal graph
  1266.      module.  This  allows  bar  and line graphs to be mixed. The
  1267.      bar  command  is  quite complex as it allows a great deal of
  1268.      flexibility.  The  same  command allows stacked, overlapping
  1269.      and grouped bars.
  1270.  
  1271.      For  stacked  bars use separate bar commands as in the first
  1272.      example below:
  1273.  
  1274.           bar d1 fill black
  1275.           bar d2 from d1 fill grey10
  1276.  
  1277.      For  grouped bars put all the datasets in a list on a single
  1278.      bar command:
  1279.  
  1280.           bar d1,d2,d3 fill grey10,grey40,black
  1281.  
  1282.  bar dx,... dist spacing
  1283.      Specifies  the  distance  between bars in dataset(s) dx,....
  1284.      The  distance is measured from the left hand side of one bar
  1285.      to  the  left  hand side of the next bar. A distance of less
  1286.      than  the  width  of  a bar results in the bars overlapping.
  1287.  
  1288.  bar dx,... from dy,...
  1289.      This  sets the starting point of each bar in datasets dx,...
  1290.      to  be  at  the  value  in  datasets dy,..., and is used for
  1291.      creating  stacked bar charts. Each layer of the bar chart is
  1292.      created with an additional bar command.
  1293.  
  1294.           bar d1,d2 
  1295.           bar d3,d4 from d1,d2
  1296.           bar d5,d6 from d3,d4
  1297.  
  1298.      Note  1:  It  is  important that the values in d3 and d4 are
  1299.      greater than the values in d1 and d2.
  1300.  
  1301.      Note  2:  Data  files for stacked bar graphs should not have
  1302.      missing  values,  replace the * character with the number on
  1303.      its left in the data file.
  1304.  
  1305.  bar dn,... width xunits,... fill col,... color col,... 
  1306.      The  rest of the bar qualifiers are fairly self explanatory.
  1307.      When  several  datasets  are  specified,  separate them with
  1308.      commas (with no spaces between commas).
  1309.  
  1310.           bar d1,d2 width 0.2 dist 0.2 fill grey10,grey20 color red,green
  1311.  
  1312.      commanddescription
  1313.  
  1314.  Filling Between Lines
  1315.  ---------------------
  1316.  
  1317.  fill x1, d3 color green xmin val xmax val 
  1318.      Fills  between  the  xaxis  and  a dataset, use the optional
  1319.      xmin,  xmax,  ymin, ymax qualifiers to clip the filling to a
  1320.      smaller region
  1321.  
  1322.  fill d4,x2 color blue ymin val ymax val 
  1323.      This    command    fills  from  a  dataset  to  the  x2axis.
  1324.  
  1325.  fill d3,d4 color green xmin val xmax val 
  1326.      This command fills between two datasets.
  1327.  
  1328.  fill d4 color green xmin val xmax val 
  1329.      This  command  treats the dataset as a polygon and fills it.
  1330.      The dataset should be a closed polygon.
  1331.  
  1332.      commanddescription
  1333.  
  1334.  Notes on Drawing Graphs
  1335.  -----------------------
  1336.  
  1337.  Importance of Order
  1338.      Most  of  the graph commands can appear in any order, but in
  1339.      some cases order is significant.
  1340.  
  1341.      As  some  let  commands  operate on data which has been read
  1342.      into  datasets,  the  data  commands  should precede the let
  1343.      commands.
  1344.  
  1345.      The  wildcard  dn  command  should appear before specific d1
  1346.      commands which it will override.
  1347.  
  1348.      By  default  xaxis  commands  also  change  the  x2axis, and
  1349.      xlabels   commands  also  change  x2labels,  so  to  specify
  1350.      different  settings  for  the  x  and  x2  axes,  put the x2
  1351.      settings after the x settings.
  1352.  
  1353.           begin graph
  1354.              size 10 10
  1355.              data a.dat
  1356.              let d2 = d1*3
  1357.              dn marker square lstyle 3   ! sets d1 and d2
  1358.              d2 marker dot
  1359.              xaxis color green
  1360.              xticks color blue
  1361.              x2axis color black
  1362.           end graph
  1363.  
  1364.  Line Width
  1365.      When  scaling a graph up or down for publication the default
  1366.      line  width  may  need changing. To do this simply specify a
  1367.      set lwidth command before beginning the graph.
  1368.  
  1369.           size 10 10 
  1370.           set lwidth .1
  1371.           begin graph
  1372.              ...
  1373.           end graph
  1374.  
  1375.  The KEY module
  1376.  --------------
  1377.      This  module  is  used  for  drawing  keys for graphs. It is
  1378.      completely separate from the graph module.
  1379.  
  1380.      Specify  a  position  for the key, the size of the lettering
  1381.      and  then for each dataset specify marker, color, lstyle and
  1382.      fill pattern:
  1383.  
  1384.           begin graph
  1385.              ...
  1386.           end graph
  1387.           begin key
  1388.              hei .5
  1389.              position tr
  1390.              text "Green trees" marker heart msize .2 fill grey10
  1391.              text "Red trees" lstyle 3 marker heart fill blue
  1392.              text "Oranges" marker circle lstyle 6 fill black
  1393.           end key
  1394.  
  1395.      All  commands to do with a particular line of the key module
  1396.      MUST appear on the same line.
  1397.  
  1398.  Key commands
  1399.  ------------
  1400.  
  1401.  offset x-exp y-exp
  1402.      Specifies  the  offset  in  cm from the current point to the
  1403.      bottom  left  hand  corner of the graph. This command should
  1404.      be on a line of its own.
  1405.  
  1406.  position justify-exp
  1407.      This  is an alternative to the OFFSET command. It allows you
  1408.      to  specify  a  position  on the graph, e.g., tl = top left.
  1409.      This  command  should  be on a line of its own. See set just
  1410.      for a list of justify settings.
  1411.  
  1412.  text str-exp
  1413.      The  text  which  will  be displayed on the end of the line.
  1414.  
  1415.  lstyle style-num
  1416.      The  line  style which will be used for the short line drawn
  1417.      in the key.
  1418.  
  1419.  marker marker-name
  1420.      The  marker  which  will  be  used for that line of the key.
  1421.  
  1422.  msize exp
  1423.      Specifies the size of the markers in cm.
  1424.  
  1425.  mscale exp
  1426.      Specifies  how  much  to scale the size of the marker. E.g.,
  1427.      0.5    would  produce  a  marker  half  as  big  as  normal.
  1428.  
  1429.  color color-name
  1430.      The colour of the text, line and marker.
  1431.  
  1432.  hei cm-exp
  1433.      This  sets  the height of the text used to draw the key. The
  1434.      key  will change in size to fit around the text. If you omit
  1435.      this command the current font size is used.
  1436.  
  1437.  fill fill-pattern
  1438.      The fill pattern used in that line of the key.
  1439.  
  1440.      commanddescription
  1441.  
  1442.  Advanced features of GLE
  1443.  ------------------------
  1444.      This  chapter  covers  the advanced features of GLE. Some of
  1445.      these  features  will  not  give exactly the same results on
  1446.      the   PC  screen  as  you  would  get  when  printing  to  a
  1447.      PostScript  printer. E.g., clipping to an arbitrary shape is
  1448.      only  implemented  in  the  PostScript driver but most other
  1449.      features  will  give  as  close  as  possible representation
  1450.      given the limitations of the screen.
  1451.  
  1452.  Color
  1453.  -----
  1454.      Internally  GLE  treats color and fill identically, they are
  1455.      simply  an  intensity  of  Red,  Green and Blue. Each of the
  1456.      predefined  color  names  (yellow,grey20,orange,red)  simply
  1457.      define the ratio of red, green and blue.
  1458.  
  1459.      There  are  two  ways to use variables to show color, one is
  1460.      for shades of grey:
  1461.  
  1462.           for i = 0 to 10
  1463.              box 3 .2 fill (i/10)
  1464.              rmove 0 .2
  1465.           next i
  1466.  
  1467.      The  other  is  for  passing  a  color  name  as a variable:
  1468.  
  1469.           sub stick c$
  1470.              box .2 2 fill c$
  1471.           end sub
  1472.           @stick "green"    
  1473.  
  1474.      Remember  a  fill pattern completely obscures what is behind
  1475.      it,  so  the  following  command  would produce a box with a
  1476.      shadow:
  1477.  
  1478.           amove 4 4 
  1479.           box 3 2 fill grey10
  1480.           rmove -.1 .1
  1481.           box 3 2 fill white
  1482.           rmove .4 .4
  1483.           text hellow
  1484.  
  1485.  Device Drivers
  1486.  --------------
  1487.      GLE supports the following devices.
  1488.  
  1489.      Interactive:  IBM/PC  (BGI),  VT100,  REGIS  (VT125, VT240),
  1490.      TEK4010, VWS, XWindows.
  1491.  
  1492.      Output:  PostScript,  HPGL,  EPSON, EPSON 24pin, HP Deskjet.
  1493.  
  1494.      Keyboard Mappings:
  1495.  
  1496.      VT100         VT200         PC         Meaning 
  1497.      GOLD 1         F11         F1         Help 
  1498.      GOLD 2         F12         F2         Save 
  1499.      GOLD 3         F13         F3         Load 
  1500.      GOLD 4         F14         F4         Save-as 
  1501.      GOLD 9         F9         F9         Graph-menu 
  1502.      GOLD 0         F10         F10         Draw-it 
  1503.      Control+Z         Control+Z     Control+Z     Exit/Escape 
  1504.                          Alt+X         Exit/Escape 
  1505.      Control+E         Control+E             Calls VAX EDT 
  1506.      Control+F         Control+F             Toggle fast/slow text 
  1507.      Control+R         Control+R     F5         Shows errors 
  1508.                          Control+S     Shells to DOS 
  1509.  
  1510.  PC Screen Drivers
  1511.      Remember  that  what you see on the screen isn't always what
  1512.      you  will  get  on  the  printer. For example filled regions
  1513.      will  not be filled, and some characters may not look right.
  1514.  
  1515.      After   pressing  F10  and  drawing  the  graph  it  can  be
  1516.      annotated  by using the mouse (or arrow keys) to draw lines,
  1517.      text  and boxes. To draw lines simply click on the points of
  1518.      the  line,  use the right hand mouse button to `pick up' the
  1519.      pen.
  1520.  
  1521.      To  draw  text  press the letter `t' and then click on where
  1522.      you would like the text to be drawn.
  1523.  
  1524.      All  movements  are  rounded to the grid size settings which
  1525.      are 1.0cm, 0.1cm, 0.01cm etc.
  1526.  
  1527.      The  height and color of the text/lines is determined by the
  1528.      current settings at the end of the GLE file.
  1529.  
  1530.      If  there  is  no mouse driver loaded then a cross-hair will
  1531.      appear  and  it  can  be  moved around using the arrow keys.
  1532.      Press    `c'    to  click,  instead  of  the  mouse  button.
  1533.  
  1534.  PostScript Driver
  1535.      To print a GLE file to the laser printer type:
  1536.  
  1537.           $ cgle myfile /print
  1538.  
  1539.      or on a PC:
  1540.  
  1541.           C:\GLE> psgle myfile   
  1542.           C:\GLE> print myfile.ps 
  1543.  
  1544.      The  postscript  drivers  for  GLE will automatically flip a
  1545.      picture  to  best  fit  onto the page, e.g. a wide graph (as
  1546.      defined  by  the  size  command at the top) will be drawn in
  1547.      landscape  mode  and  a  tall  thin  graph  will be drawn in
  1548.      portrait mode.
  1549.  
  1550.      To  produce  an  .eps file on a VAX for inclusion in LaTeXor
  1551.      WordPerfect you would type:
  1552.  
  1553.           $ cgle myfile /dev=eps
  1554.  
  1555.      On a PC you would type:
  1556.  
  1557.           C:\GLE> psgle myfile  /eps
  1558.           (this creates myfile.eps, not myfile.ps)
  1559.  
  1560.      Inside your LaTeXdocument use the LaTeXcommand:
  1561.  
  1562.           \graphin{myfile.eps}{12.0cm}{3.0cm}{1.0}
  1563.  
  1564.      The  width  and  height  are  used by LaTeXto reserve enough
  1565.      space  for  the  drawing  and  the last parameter is a scale
  1566.      factor.
  1567.  
  1568.      The  laser  printer  driver  will  draw all zero width lines
  1569.      .02cm  wide  for  any  line  width  equal to zero, but if an
  1570.      lwidth  is greater than zero and less than or equal to .0001
  1571.      then  it  will  use a line width of 1 pixel. Without this it
  1572.      would  be  impossible  to  specify  a line width that didn't
  1573.      occasionally get rounded to 2 pixels.
  1574.  
  1575.  TEK4010 Driver
  1576.      This  driver  allows  initialization sequences to be defined
  1577.      with the symbols TEK_OPEN and TEK_CLOSE.
  1578.  
  1579.      On  a  VAX this is normally done by CGLECMD.COM so that when
  1580.      you  specify  /DEV=V550  the  assignments  are done for you.
  1581.      (V550 = Visual 550)
  1582.  
  1583.  HPGL Driver
  1584.  
  1585.  Device Drivers>HPGL Driver
  1586.      This  driver  allows  initialization sequences to be defined
  1587.      in  the  symbols  HPGL_OPEN  and  HPGL_CLOSE.  On the PC use
  1588.      environment  variables  and on the VAX use DCL symbols. Also
  1589.      HPGL_WIDTH  and  HPGL_HEIGHT  can  be  defined  for  non  A3
  1590.      plotters.
  1591.  
  1592.      On  a  VAX this is normally done by CGLECMD.COM so that when
  1593.      you  specify  /DEV=HPA4  the  assignments  are done for you.
  1594.  
  1595.      The   HPGL  driver  assigns  the  following  colors  to  pen
  1596.      numbers:
  1597.  
  1598.      1=black,    2=red,    3=green,  4=blue,  5=magenta,  6=white
  1599.  
  1600.  PC Bitmap Drivers
  1601.      GLE  supports the EPSON 8 and 24 pin and HP deskjet/laserjet
  1602.      printers.  To  support  bitmap devices which require a large
  1603.      amount  of memory GLE first writes a device independent file
  1604.      OUT.DVI,   then  the  appropriate  bitmap  driver  for  your
  1605.      printer  will  read  the  OUT.DVI  file  and create a bitmap
  1606.      which it then prints to LPT1:
  1607.  
  1608.           C:> dvigle myfile      (produces OUT.DVI)
  1609.           C:> dviepson           (creates bitmap and prints to LPT1:)
  1610.  
  1611.      The output options are:
  1612.  
  1613.           C:> dviepson           Standard EPSON printers 
  1614.           C:> dviep24            24 Pin EPSON printers (180dpi)
  1615.           C:> dvilj              HP Laser jet, Desk jet (150 dpi)
  1616.           C:> dvilj300           HP Laser jet, Desk jet (300 dpi)
  1617.  
  1618.      The    high   resolution  drivers  (dviep24,  dvilj300)  are
  1619.      significantly  slower  than  the  low  resolution drivers so
  1620.      would only be used for final output.
  1621.  
  1622.      See  the  file  AAREADME.GLE  for  the latest information on
  1623.      drivers.
  1624.  
  1625.  Fonts (font mapping)
  1626.      By  default the generic fonts (rm, rmb, ss, tt etc) will all
  1627.      map  to  PLSR  (plotter  simplex  roman)  on BITMAP and HPGL
  1628.      drivers.  To  make  this  happen  on  other  drivers put the
  1629.      command  plotter fonts immediately after the size command at
  1630.      the top of the GLE file.
  1631.  
  1632.      A  typical  result of this change in fonts is that something
  1633.      that  lines  up  on the screen will not line up when printed
  1634.      to  an  EPSON  printer. If this happens then use the plotter
  1635.      fonts command.
  1636.  
  1637.      If  a  character  is  missing  from  a  font,  or  isn't the
  1638.      particular  variation  you  like, you can define a character
  1639.      to be from a different font in this way:
  1640.  
  1641.           \chardef{%}{{\setfont{texcmr}\char{37}}} 
  1642.           \chardef{[}{{\setfont{texcmr}\char{91}}} 
  1643.           \chardef{]}{{\setfont{texcmr}\char{93}}} 
  1644.  
  1645.      On  the  PC  some  fonts  may  not be installed to save disk
  1646.      space.  When  one  of  the  missing  fonts  is called for, a
  1647.      replacement  font  will be displayed, this may look terrible
  1648.      and   some  special  characters  may  be  completely  wrong.
  1649.  
  1650.      More  importantly  if you use a font which does not have its
  1651.      font  metric  file  installed  (e.g.  C:/GLE/FONTS/PLSR.FMT)
  1652.      then   the  PostScript  driver  will  space  the  characters
  1653.      incorrectly.    This    can  be  fixed  by  extracting  that
  1654.      particular    metric    file   from  the  distribution  file
  1655.      CGLE_FVE.ZIP using PKUNZIP.
  1656.  
  1657.  Diagrams, Joining Named Objects
  1658.  -------------------------------
  1659.      To  draw  lines between boxes which contain text, first name
  1660.      each  box  as  it  is drawn and then use the join command to
  1661.      draw the lines between the boxes.
  1662.  
  1663.           box 2 3 fill blue  name square
  1664.           amove 5 5 
  1665.           begin box add .1  name titlebox
  1666.                text Title
  1667.           end box
  1668.           join square.tr -> titlebox.bc
  1669.  
  1670.      These  commands  draw  a  line from the ``Top Right'' of the
  1671.      square  to  the  ``Bottom  Centre'' of the titlebox, with an
  1672.      arrow at the titlebox end.
  1673.  
  1674.           join square - titlebox
  1675.  
  1676.      would  draw  a  line  from  the  centre of the square to the
  1677.      centre  of  the  titlebox but clipped correctly at the edges
  1678.      of both boxes.
  1679.  
  1680.           join square.tc <-> titlebox.v
  1681.  
  1682.      would  draw  a  vertical  line  from  the  top centre of the
  1683.      square    to    the  titlebox  with  arrows  at  both  ends.
  1684.  
  1685.      Named points on each box:
  1686.  
  1687.              .bl    Bottom left
  1688.              .bc    Bottom centre
  1689.              .br    Bottom right
  1690.              .cr    Centre right
  1691.              .tr    Top right
  1692.              .tc    Top centre
  1693.              .tl    Top left
  1694.              .cl    Centre left
  1695.              .v     Vertical line
  1696.              .h     Horizontal line
  1697.              .cc    Centre centre
  1698.              .ci    Circle clipping    (for drawing lines to a circle)
  1699.  
  1700.      To  draw  lines to a given point, simply move there and save
  1701.      that point as a named object.
  1702.  
  1703.          rmove 2 3
  1704.          save apoint
  1705.          join apoint - square
  1706.  
  1707.  Filling, Stroking and Clipping Paths
  1708.  ------------------------------------
  1709.      It  is  possible to set up arbitrary clipping regions. To do
  1710.      this  draw  a  shape  and  make  it into a path by putting a
  1711.      begin  path  clip  ...  end  path,  around it. Then draw the
  1712.      things  to  be  clipped  by that region. To clear a clipping
  1713.      path  surround  the whole section of GLE commands with begin
  1714.      clip ... end clip
  1715.  
  1716.      Characters  can  be used to make up clipping paths, but only
  1717.      the  PostScript  fonts will currently work for this purpose.
  1718.  
  1719.      Clipping  doesn't  work  on  the  screen or p79 devices, but
  1720.      does  on  the  laser printer. See example CLIP.GLE at end of
  1721.      manual.
  1722.  
  1723.           size 10 5 
  1724.           begin clip       ! Save current clipping path
  1725.              begin path clip stroke  ! Define new clipping region
  1726.                 amove 2 2 
  1727.                 box 3 3 
  1728.                 amove 6 2 
  1729.                 box 3 3 
  1730.              end path
  1731.              amove 2 2 
  1732.              set hei 3
  1733.              text Here is clipped text
  1734.           end clip         ! Restore original clipping path
  1735.  
  1736.  Using Variables
  1737.  ---------------
  1738.      GLE  has  two types of variables, floating point and string.
  1739.      String  variables  always  end  with a dollar sign. A string
  1740.      variable  contains  text  like  ``Hello  this  is  text'', a
  1741.      floating  point  variable  can  only  contain  numbers  like
  1742.      1234.234.
  1743.  
  1744.           name$ = "Joe"
  1745.           height = 6.5    ! Height of person
  1746.           shoe = .05      ! shoe adds to height of person
  1747.           amove 1 1
  1748.           box .2 height+shoe
  1749.           write name$    
  1750.  
  1751.  Programming Loops
  1752.  -----------------
  1753.      The  simple  way  to  draw  a  6 $$ 8 grid would be to use a
  1754.      whole mass of line commands:
  1755.  
  1756.           amove 0 0 
  1757.           rline 0 8 
  1758.           amove 1 0 
  1759.           rline 1 8 
  1760.           ...
  1761.           amove 6 0 
  1762.           rline 6 8
  1763.  
  1764.      this  would  be  laborious  to  type  in,  and  would become
  1765.      impossible  to  manage with several grids. By using a simple
  1766.      loop this can be avoided:
  1767.  
  1768.           for x = 0 to 6
  1769.              amove x 0 
  1770.              rline x 8 
  1771.           next x
  1772.           for y = 0 to 8
  1773.              amove 0 y 
  1774.              rline 6 y 
  1775.           next y 
  1776.  
  1777.      To  draw  lots  of  grids  all  of  different  dimensions  a
  1778.      subroutine  can  be  defined  and then used again and again:
  1779.  
  1780.           ! define the subroutine
  1781.           sub grid nx ny 
  1782.           gsave
  1783.           begin origin
  1784.           for x = 0 to nx
  1785.              amove x 0 
  1786.              aline x ny 
  1787.           next x
  1788.           for y = 0 to ny
  1789.              amove 0 y 
  1790.              aline nx y 
  1791.           next y 
  1792.           end origin
  1793.           end sub
  1794.           ! now draw the grids wherever
  1795.           amove 2 4
  1796.           @grid 6  8
  1797.           amove 2 2
  1798.           @grid 9 5
  1799.  
  1800.      Now  the  main  GLE  file  will  be  much  easier  to modify
  1801.      particularly  if  the  subroutine definition is moved into a
  1802.      separate file:
  1803.  
  1804.           size 10 10
  1805.           include griddef.gle
  1806.           amove 2 4
  1807.           @grid 2 4
  1808.           amove 2 2
  1809.           @grid 9 5
  1810.  
  1811.  Tables
  1812.  ------
  1813.  
  1814.  Markers
  1815.  -------
  1816.  
  1817.  Fonts
  1818.  -----
  1819.  
  1820.      font-name     Description 
  1821.      rm     Roman 
  1822.      rmb     Roman Bold 
  1823.      rmi     Roman Italic 
  1824.      ss     San Serif 
  1825.      ssb     San Serif Bold 
  1826.      ssi     San Serif Italic 
  1827.      tt     Typewriter 
  1828.      ttb     Typewriter Bold 
  1829.      tti     Typewriter Italic 
  1830.  
  1831.  
  1832.      font-name     Description 
  1833.      psagb     AvantGarde-Book 
  1834.      psagbo     AvantGarde-BookOblique 
  1835.      psbd     Bookman-Demi 
  1836.      psbdi     Bookman-DemiItalic 
  1837.      psbl     Bookman-Light 
  1838.      psbli     Bookman-LightItalic 
  1839.      psc     Courier 
  1840.      pscb     Courier-Bold 
  1841.      pscbo     Courier-BoldOblique 
  1842.      psco     Courier-Oblique 
  1843.      psh     Helvetica 
  1844.      pshb     Helvetica-Bold 
  1845.      pshbo     Helvetica-BoldOblique 
  1846.      psho     Helvetica-Oblique 
  1847.      psncsb     NewCenturySchlbk-Bold 
  1848.      psncsi     NewCenturySchlbk-Italic 
  1849.      psncsr     NewCenturySchlbk-Roman 
  1850.      pspr     Palatino-Roman 
  1851.      pstr     Times-Roman 
  1852.      psti     Times-Italic 
  1853.      pstb     Times-Bold 
  1854.      pstbi     Times-BoldItalic 
  1855.      pszcmi     ZapfChancery-MediumItalic 
  1856.      pszd     ZapfDingbats 
  1857.      pssym     Symbol 
  1858.  
  1859.      font-name     Description 
  1860.      texcmb     Computer Modern Bold 
  1861.      texcmex     Computer Modern Extensible 
  1862.      texcmitt     Computer Modern Italic Typewriter 
  1863.      texcmmi     Computer Modern Maths Italic 
  1864.      texcmr     Computer Modern Roman 
  1865.      texcmss     Computer Modern Sans Serif 
  1866.      texcmssb     Computer Modern Sans Serif Bold 
  1867.      texcmssi     Computer Modern Sans Serif Italic 
  1868.      texcmsy     Computer Modern Symbol 
  1869.      texcmti     Computer Modern Text Italic 
  1870.      texcmtt     Computer Modern Typewriter Text 
  1871.  
  1872.      font-name     Description 
  1873.      plcc     Complex Cartographic 
  1874.      plcg     Complex Gothic 
  1875.      plci     Complex Italic 
  1876.      plcr     Complex Roman 
  1877.      plcs     Complex Script 
  1878.      pldr     Duplex Roman 
  1879.      plge     Gothic English 
  1880.      plgg     Gothic German 
  1881.      plgi     Gothic Italian 
  1882.      plsa     Simplex Ascii 
  1883.      plsg     Simplex German 
  1884.      plsr     Simplex Roman 
  1885.      plss     Simplex Script 
  1886.      plsym1     Symbols one 
  1887.      plsym2     Symbols two 
  1888.      plti     Triplex Italic 
  1889.      pltr     Triplex Roman 
  1890.      plba     Block Ascii 
  1891.  
  1892.  Functions
  1893.  ---------
  1894.  
  1895.      Function Name         Returns 
  1896.      TIME$()             current time e.g. ``11:44:27'' 
  1897.      DATE$()             current date e.g. ``Tue Apr 09 1991'' 
  1898.      LEFT$(str$,exp)         left exp characters of str$ 
  1899.      RIGHT$(str$,exp)         rest of str$ starting at exp 
  1900.      SEG$(str$,exp1,exp2)     str$ from exp1 to exp2 
  1901.      NUM$(exp)             string representation of exp 
  1902.      NUM1$(exp)         as above but with no spaces 
  1903.      VAL(str$)             value of the string str$ 
  1904.      POS(str1$,str2$,exp)     position of str2$ in str1$ from exp 
  1905.      LEN(str$)             the length of str$ 
  1906.  
  1907.      Function Name         Returns 
  1908.      ABS(exp)             absolute value of expression 
  1909.      ATN(exp)             arctan 
  1910.      COS(exp)             cosine 
  1911.      EXP(exp)             exponent 
  1912.      FIX(exp)             exp rounded towards 0 
  1913.      INT(exp)             integer part of exp 
  1914.      LOG(exp)             log to base e of exp 
  1915.      LOG10(exp)         log to base 10 of exp 
  1916.      SGN(exp)              returns  1  or -1.
  1917.      SIN(exp)             sine of exp 
  1918.      SQR(exp)             exp squared 
  1919.      TAN(exp)             tangent of exp 
  1920.      NOT(exp)             logical not of exp 
  1921.      RND(exp)             random number from seed exp 
  1922.      SQRT(exp)             square root of exp 
  1923.  
  1924.      Function Name         Returns 
  1925.      XEND()             the x end point of a text string when drawn 
  1926.      YEND()             the y end point of a text string when drawn 
  1927.      XPOS()             the current x point 
  1928.      YPOS()             the current y point 
  1929.      TWIDTH(str$)          the width of str$ assuming current font, size
  1930.      THEIGHT(str$)          the  height  of  str$ assuming current font, size 
  1931.      TDEPTH(str$)          the  depth of str$ 
  1932.      XG(xexp)             converts units of last graph to abs cm. 
  1933.      YG(yexp)              converts  units  of last graph to abs cm. tabular
  1934.  
  1935.